package com.ant.temple.activities;

import java.io.IOException;
import java.io.InputStream;

import android.content.res.AssetManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;

import com.ant.temple.R;

/**
 * @author Administrator
 */
public class Test01 extends BaseActvity  {
	private ImageView image;
	private Button obt01;

	@Override
	public void initview() {
		this.setContentView(R.layout.activity_test01);
		image=(ImageView) findViewById(R.id.test01_image01);
		obt01=(Button) findViewById(R.id.test01_obt01);
	}

	@Override
	public void init() {

	}

	@Override
	public void data() {
	}

	@Override
	public void listener() {
		obt01.setOnClickListener(new OnClickListener() {


			@Override
			public void onClick(View v) {
				try {
					AssetManager assetsManager = getAssets();
					String path="source/images/pic_41.jpg";
					Bitmap bm = BitmapFactory.decodeStream(assetsManager.open(path));
					image.setImageBitmap(bm);
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		});
	}

}
